from rest_framework import serializers
from .models import AdvertisingCate, Contents


class AdvertisingCateModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = AdvertisingCate
        fields = ('id', 'name')


class ContentsModelSerializer(serializers.ModelSerializer):
    cate = AdvertisingCateModelSerializer()

    class Meta:
        model = Contents
        fields = ('id', 'cate', 'img', 'is_show', 'serial_number', 'title', 'content')


